Attribute VB_Name = "Module1"
'Example:
            'Dim krnc as clsCurrency
'Set krnc = New clsCurrency
'to use the regional  language krnc.vCurrency = 12,8333 (uses comma)
            'Debug.print krnc.vUSACurrency  =>  12.8333 (returns decimal point)
            'Now pass the Imperial value to the software subroutine
            'Likewise the opposite is true
'to use the stored value krnc.vUSACurrency = 12.8333 (uses decimal point)
            'Debug.print krnc.vCurrency  =>  12,8333 (returns comma or decimal point depending on the regional setting)
            'Now pass the Regional value to the software subroutine


'local variable(s) to hold property value(s)
'
Private Declare Function GetLocaleInfo Lib "kernel32.dll" _
   Alias "GetLocaleInfoA" _
  (ByVal Locale As Long, _
   ByVal LCType As Long, _
   ByVal lpLCData As String, _
   ByVal cchData As Long) As Long
Private mvarUSACurrency As Variant 'local copy
Private mvarvCurrency As Variant 'local copy

Public Property Get localComma() As String
    localComma = Replace(winlocaleinfo(&HC), Chr(0), "") '&HB
End Property
Public Property Get localDollarSign() As String
    localDollarSign = Replace(winlocaleinfo(&H14), Chr(0), "") 'GetCurrencySymbol
End Property
Public Property Get localDecimal() As String
    localDecimal = Replace(winlocaleinfo(&HE), Chr(0), "")
End Property
Public Property Let vCurrency(ByVal vData As Variant)
    On Error Resume Next
    If vData = vbNullString Then vData = 0
    mvarvCurrency = vData
    If Not localDecimal = "." Then
        mvarUSACurrency = Replace(CCur(vData), localDecimal, ".")
        If Err.Number > 0 Then mvarUSACurrency = val(vData)
    Else
        mvarUSACurrency = vData
    End If
End Property
Public Property Get vCurrency() As Variant
    If Not IsNumeric(mvarvCurrency) Then
        mvarvCurrency = 0
    End If
    vCurrency = CCur(mvarvCurrency)
End Property
Public Property Let vUSACurrency(ByVal vData As Variant)
    If Not localDecimal = "." Then
        If InStrB(vData, localDecimal) > 0 Then
            mvarvCurrency = Replace(vData, ".", localDecimal)
        ElseIf InStrB(vData, ".") > 0 Then
            mvarvCurrency = Replace(vData, ".", localDecimal)
        Else 'no punctuation in string
            mvarvCurrency = vData
            mvarUSACurrency = vData
        End If
    End If
    If InStrB(vData, localDecimal) > 0 Then
        mvarUSACurrency = Replace(vData, localDecimal, ".")
        mvarvCurrency = vData
    ElseIf InStrB(vData, ".") > 0 Then
        mvarUSACurrency = Replace(vData, localDecimal, ".")
    Else 'no punctuation in string
        mvarUSACurrency = vData
        mvarvCurrency = vData
    End If
End Property
Public Property Get vUSACurrency() As Variant
        vUSACurrency = mvarUSACurrency
End Property



'Place the following in a module





Public Function winlocaleinfo(ByVal infotype As Long) As String
Dim slcdata As String
Dim nRet As Long
    nRet = GetLocaleInfo(0, infotype, slcdata, 0)
    If nRet Then
        slcdata = Space$(nRet)
        nRet = GetLocaleInfo(0, infotype, slcdata, Len(slcdata))
        If nRet Then winlocaleinfo = Left(slcdata, nRet)
    End If
End Function


